{extend name="default/template/base_index" /}


{block name="area_header"}

{/block}

{block name="area_body"}
	{include file="default/Widget/topbar" /}
	<div class="admin-main container-fluid">
		{include file="default/Widget/left" /}
		<div class="admin-main-content">
			{include file="default/Widget/breadcrumb" /}
			<!-- 过滤\查询按钮 -->
				<div class="filter-controls">
					<!-- 日期查询 -->
					<form action="{:url('Datatree/search')}" method="post" class="form-inline">
						<input type="hidden" name="parent" value="{$parent}" />
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									名称
								</div>
								<input type="text" name="name" id="name" class="form-control input-short" value="{$name}" />
							</div>
						</div>
						<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
					</form>
				</div>
				<!-- 操作按钮 -->
				<div class="btn-controls">
					<a class="btn btn-primary btn-sm" href="{:url('Datatree/add',array('parent'=>$parent))}"><i class="fa fa-plus"></i>{:L('BTN_ADD')}</a>

					{neq name="parent" value="0"}
						<a class="btn btn-default btn-sm" href="{:url('Datatree/index',array('parent'=>$preparent))}"><i class="fa fa-reply"></i>返回</a>
					{/neq}
				</div>

				<table class="table table-striped table table-hover  table-condensed">
					<thead>
						<tr>
							<th>
								<input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />
							</th>
							<th>ID</th>
							<th>
								排序
							</th>
							<th>唯一数据编码</th>
							<th>名称</th>
							<th>别名</th>
							<!--<th>
								父级路径
							</th>-->
							<th>
								添加时间
							</th>
							<th>
								操作
							</th>
						</tr>
					</thead>
					<tbody>
						{empty name="list"}
							<tr>
								<td colspan="6" class="text-center">{:L('NO_DATA')}</td>
							</tr>
							{else/}
							{volist name="list" id="vo"}
								<tr>
									<td>
										<input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" /></td>

									<td>{$vo['id']}</td>
									<td>
										{$vo.sort}
									</td>
									<td>{$vo['code']}</td>
									<td>
										<a href="{:url('Datatree/index',array('parent'=>$vo['id']))}">{$vo.name}</a>
									</td>
									<td>{$vo['alias']}</td>
									<!--<td>
										{$vo.parents}
									</td>-->
									<td>
										{$vo.create_time|date='Y-m-d h:i:s',###}
									</td>
									<td>
										<a href="{:url('Datatree/edit',array('id'=>$vo['id'],'parent'=>$vo['parentid']))}" class="btn btn-sm btn-default"><i class="fa fa-edit"></i>编辑</a>
										<a href="{:url('Datatree/delete',array('id'=>$vo['id'],'parent'=>$vo['parentid']))}" class="btn btn-sm btn-danger ajax-get confirm"><i class="fa fa-trash"></i>删除</a>
										<a href="{:url('Datatree/deleteChildren',array('id'=>$vo['id'],'parent'=>$vo['parentid']))}" class="btn btn-sm btn-danger ajax-get confirm"><i class="fa fa-trash"></i>删除子级</a>

									</td>
								</tr>

							{/volist}
						{/empty}
					</tbody>
				</table>
				<div>{$show}</div>
			</div>
		</div>
		<!-- END admin-main-content -->
	</div>
		<!-- END admin-main-->
{/block}

{block name="area_footer"}

{/block}